package jp.wug;

import com.google.inject.Key;

import java.util.HashMap;
import java.util.Map;

public class WugConversation {
    Map<Key<?>, Object> conversationObjects = new HashMap<Key<?>, Object>();
    String key;

    public WugConversation(String key) {
        this.key = key;
    }

    @SuppressWarnings("unchecked")
    public <T> T get(Key<T> key) {
        return (T) conversationObjects.get(key);
    }

    public boolean containsKey(Key<?> key) {
        return conversationObjects.containsKey(key);
    }

    public <T> void put(Key<T> key, T t) {
        conversationObjects.put(key, t);
    }
}
